package com.ykdl.member.kid.marketcard;

import java.util.Timer;
import java.util.TimerTask;

import android.app.AlertDialog;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

import com.tencent.mm.sdk.constants.ConstantsAPI;
import com.tencent.mm.sdk.modelbase.BaseReq;
import com.tencent.mm.sdk.modelbase.BaseResp;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.IWXAPIEventHandler;
import com.tencent.mm.sdk.openapi.WXAPIFactory;
import com.ykdl.member.kid.R;
import com.ykdl.member.kid.gears.BaseScreen;

public class PaySuccessActivity extends BaseScreen{
	
	TextView clickHereView;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setTopTitle("支付成功", 0, R.drawable.back_bg, null, 0, 0, null, R.drawable.title_bg, false);
		setContent(R.layout.activity_pay_success);
		initView();
	}
	
	private void initView(){
		clickHereView = (TextView) findViewById(R.id.click_here);
		
		clickHereView.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				goToMyOrderActivity();
			}
		});
		
		Timer timer = new Timer();
		timer.schedule(new TimerTask() {
			
			@Override
			public void run() {
				// TODO Auto-generated method stub
				goToMyOrderActivity();
			}
		}, 4000);
		
	}
	
	private void goToMyOrderActivity(){
		Intent intent = new Intent(PaySuccessActivity.this, MyOrderActivity.class);
		intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
		startActivity(intent);
		finish();
	}
	
	@Override
	public void onBackPressed() {
		// TODO Auto-generated method stub
		goToMyOrderActivity();
	}
	
}
